//卷组列表
(function($){
    $(function(){
        var resizePage = (function () {
            $("body , .shared-storage-page").height($(window).height());
            var ww = $(window).width(),
                wh = $("body").innerHeight(),
                searchH = $(".tab-a").outerHeight(true),
                footerH = $(".table-footer").outerHeight(true),
                ulHeaderH = $(".ul_head").outerHeight(true),
                topFootH = $(".pop-foot").outerHeight(true),
                $topUlBody = $(".top_ul_body"),
                $ulBody = $(".ul_body");

            $ulBody.height(wh - searchH - footerH - ulHeaderH);
            //$topUlBody.height(wh - searchH - topFootH - ulHeaderH);
            return arguments.callee;
        })();
        $(window).resize(resizePage);
        
        var top = window.parent.parent;

        //分页
        var initPagination = function() {
            var total_page = 50;
            $("#pagination").pagination(total_page,{
                items_per_page : 10,
                prev_text:"上一页",
                next_text:"下一页",
                num_edge_entries : 3,
                ellipse_text : '...',
                num_display_entries : 5	,
                callback: page_callback,
                link_to : 'javascript:void(0)'
            });
        }();
        //分页点击回调
        function page_callback(page_index, jq){
            return false;
        }
        
        //搜索栏相关操作
        /*$(".tab-a")
        	//创建卷组
        	.on("click",".create-volume",function(){
        		top.$.popShow("pages/volumeManage/create_volume.html");
        	})*/
        	
        
        //列表内相关操作
        $(".table")
        	//创建快照
        	.on("click",".create-photo",function(e){
        		e.stopPropagation();
        		top.$.popShow("pages/volumeManage/create_photo.html");
        	})

        //调用animateTip插件
        $(".undel-icon").animateTip({
        	my:"center+12 top+4",
            at:"center bottom"
        });
		
		//挂载按钮 挂载飞出层飞出
        $(".li_tr")
            .on("click",".mount-volume",function () {
                window.parent.$(".mount-manage").fadeIn(600);
            })

        //点共享存储名称 飞出详情页面
        $(".ul_body")
        //关闭管理规则
            .on("click",".det-style",function(){
                window.parent.$(".det-page").fadeIn(600);
            })

        //关闭详情页面
        window.parent.$(".det-page-panel")
        //关闭管理规则
            .on("click",".close-pop",function(){
                window.parent.$(".det-page").fadeOut(600);
            })

        //调用滚动条插件
        $(".product-nicescroll").niceScroll({
            cursorcolor: "#0099ff",
            autohidemode: false,
            cursorwidth: "8px",
            cursorborder: "0",
            cursorborderradius: "5px",
            railpadding: {
                right: 5,
                top: 1
            }
        });
        //
        $(".tab-a")
        //编辑安全组
            .on("click",".add-btn",function(){
                top.$.popShow("pages/storageManage/add_sharedStorage.html");
            })
    })
})(jQuery)